package cn.iocoder.yudao.module.wecom.enums;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum WxMsgTypeEnum {

    SUITE_TICKET("suite_ticket", "企业登录ticket"),
    CREATE_AUTH("create_auth", "企业授权成功"),
    CHANGE_AUTH("change_auth", "企业授权变更"),
    CANCEL_AUTH("cancel_auth", "企业取消授权"),
    CUSTOMER_ACQ("customer_acquisition", "获客助手通知"),


    EVENT("event", "专区程序通知事件"),
    PROGRAM_NOTIFY("program_notify", "专区程序通知事件"),

    ;

    private final String msgType;

    private final String name;

    /**
     * 判断是否为企业授权成功
     * @param msgType
     * @since 2024-07-18
     * @author PetePower
     * @return
     */
    public static Boolean isSuiteTicket(Object msgType) {
        return ObjectUtil.equal(SUITE_TICKET.msgType, msgType);
    }

    /**
     * 判断是否为企业授权成功
     * @param msgType
     * @since 2024-07-18
     * @author PetePower
     * @return
     */
    public static Boolean isCreateAuth(Object msgType) {
        return Objects.equals(CREATE_AUTH.msgType, msgType);
    }

    public static Boolean isChangeAuth(Object msgType) {
        return Objects.equals(CHANGE_AUTH.msgType, msgType);
    }

    /**
     * 取消授权通知类型
     * @param msgType
     * @since 2024-08-29
     * @author PetePower
     * @return
     */
    public static Boolean isCancelAuth(Object msgType) {
        return Objects.equals(CANCEL_AUTH.msgType, msgType);
    }

    public static Boolean isCustomerAcq(Object msgType) {
        return Objects.equals(CUSTOMER_ACQ.msgType, msgType);
    }

    public static Boolean isEvent(Object msgType) {
        return Objects.equals(EVENT.msgType, msgType);
    }
    public static Boolean isProgramNotify(Object msgType) {
        return Objects.equals(PROGRAM_NOTIFY.msgType, msgType);
    }
}
